package com.leaderpro.launch;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

public class Main {
	public static void main(String[] args) throws ClassNotFoundException,
			SQLException {
		
		Class.forName("oracle.jdbc.driver.OracleDriver");
		Connection connection = DriverManager.getConnection(
				"jdbc:oracle:thin:@localhost:1521:xe", "SYSTEM", "Baitdlu2008");
		//connection.setAutoCommit(false);

		Statement sttm = connection.createStatement();
		
		ResultSet rs = sttm.executeQuery("SELECT * FROM Categories");
		while(rs.next()){
			System.out.println(rs.getString(2));
		}
		
		connection.close();
		
	}

}
